package cn.com.open.itembank.dto;

import com.google.gson.Gson;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by lucky on 2017/12/19.
 */
public class CustomerResponse {
    /**
     * The Body.
     */
    String body;
    /**
     * The Success.
     */
    boolean success;
    /**
     * The Error.
     */
    String error;
    /**
     * The Message.
     */
    String message;

    /**
     * Instantiates a new Customer response.
     */
    public CustomerResponse() {
    }

    /**
     * Sets body content.
     *
     * @param content the content
     */
    public void setBodyContent(String content) {
        this.body = content;
    }

    /**
     * Parse boolean.
     *
     * @return the boolean
     */
    public boolean parse() {
        return false;
    }

    /**
     * Parse json map.
     *
     * @return the map
     */
    public Map<String, Object> parseJson() {
        Gson gson = new Gson();
        return (Map) gson.fromJson(this.body, (new HashMap()).getClass());
    }

    /**
     * Gets body.
     *
     * @return the body
     */
    public String getBody() {
        return this.body;
    }

    /**
     * Is success boolean.
     *
     * @return the boolean
     */
    public boolean isSuccess() {
        return this.success;
    }

    /**
     * Sets success.
     *
     * @param success the success
     */
    public void setSuccess(boolean success) {
        this.success = success;
    }

    /**
     * Gets error.
     *
     * @return the error
     */
    public String getError() {
        return this.error;
    }

    /**
     * Sets error.
     *
     * @param error the error
     */
    public void setError(String error) {
        this.error = error;
    }

    /**
     * Gets message.
     *
     * @return the message
     */
    public String getMessage() {
        return this.message;
    }

    /**
     * Sets message.
     *
     * @param message the message
     */
    public void setMessage(String message) {
        this.message = message;
    }

}
